#ifndef _BARTER_SERVER_CONNECTION_H_
#define _BARTER_SERVER_CONNECTION_H_

#ifdef WIN32
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
typedef sock_t SOCKET;
#else
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
typedef sock_t int;
#endif

class Connection
{
private:
	sock_t Socket;
	Connection(const Connection&);
	Connection& operator=(const Connection&);
public:
	Connection(sock_t socket);
	~Connection();
	bool Read(NetworkMessage*);
	bool Write(NetworkMessage*);
	bool IsOpen();
	void Close(); // close down the connection
};

#endif // _BARTER_SERVER_CONNECTION_H_
